<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/16
 * Time: 13:49
 */

namespace Modules\Api\Http\Controllers;

use Illuminate\Http\Request;
use Modules\Api\Service\UpKeepService;

class UpKeepController extends BaseController
{

    /**
     *  添加保养记录（手动）
     *  hinq 2019 11 16
     *
     **/
    public function store_upkeep( Request $request ){
        $arr_input = (array) $request->all();
        $arr_list = UpKeepService::store_upkeep( (array) $arr_input );
        return response_json( $arr_list );
    }

    /**
     *  保养记录列表
     *  hinq 2019 11 16
     *
     **/
    public function list_upkeep( Request $request )
    {
        $arr_input = (array) $request->all();
        $arr_list = UpKeepService::list_upkeep( (array) $arr_input );
        return response_json( $arr_list );
    }

    /**
     *  获取指定保养记录详情
     *  hinq 2019 11 18
     *
     ***/
    public function detail_upkeep( Request $request ){
        $nId = (int) $request->get('id');
        $arr_list = UpKeepService::detail_upkeep( (int) $nId );
        return response_json( $arr_list );
    }

    /**
     *  编辑指定的保养数据
     *  hinq 2019 11 18
     *
     **/
    public function update_upkeep( Request $request ){
        $arr_input = (array) $request->all();
        $arr_list = UpKeepService::update_upkeep( (array) $arr_input );
        return response_json( $arr_list );
    }

    /**
     *  获取所有的保养项目列表
     *  hinq 2019 11 18
     *
     **/
    public function upkeep_types(){
        $arr_list = UpKeepService::upkeep_types();
        return response_json( $arr_list );
    }


}